Helper.login = {};
Helper.login.checkcode = function(id) {
	var newUrl = "";
	var oldUrl = $("#" + id).attr("src");
	if (oldUrl.indexOf("?") != -1) {
		newUrl = oldUrl.substring(0, oldUrl.indexOf("?")) + "?refresh="
				+ Math.random() * 100;
	} else {
		newUrl = oldUrl + "?refresh=" + Math.random() * 100;
	}
	//$("#" + id).attr("src", newUrl);
	$("img[id$=" + id + "]").attr("src", newUrl);
};
Helper.login.validata = function(vcode){
	$("#error_message_div").hide();
	var message ;
	if(vcode.length!==4) {
		message = "请输入正确的4位验证码.";
	}
	if(message) {
		$("#login_page_error_span").html(message);
		$("#error_message_div").show(200);
		return;
	}
	$("#error_message_div").hide();
	return true;
};

